<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>图标生成器 - 在线生成各平台图标</title>
  <link rel="stylesheet" href="css/style.css">
  <link rel="stylesheet" href="css/responsive.css">
  <!-- 添加网站图标 -->
  <link rel="icon" href="favicon.ico" type="image/x-icon">
  <!-- 添加JSZip库 -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
</head>
<body>
  <div class="container">
    <header>
      <h1>图标生成器</h1>
      <p>上传一个图像，轻松生成各平台所需的应用图标</p>
    </header>
    
    <main>
      <section id="uploadSection" class="section upload-section">
        <div class="card">
          <div class="card-header">
            <h2>上传图像</h2>
          </div>
          <div class="card-body">
            <div id="dropArea" class="drop-area">
              <div id="uploadContent" class="upload-content">
                <div class="drop-icon">
                  <svg width="64" height="64" viewBox="0 0 24 24">
                    <path d="M19.35 10.04C18.67 6.59 15.64 4 12 4 9.11 4 6.6 5.64 5.35 8.04 2.34 8.36 0 10.91 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"/>
                  </svg>
                </div>
                <p>拖放图像到这里或点击上传</p>
                <p class="hint">建议上传1024×1024像素的PNG图像</p>
                <button id="uploadBtn" class="btn btn-primary">选择图像</button>
                <input type="file" id="fileInput" accept="image/*" hidden>
              </div>
              
              <div id="previewContent" class="preview-content" style="display: none;">
                <div class="preview-container">
                  <img id="previewImage" src="" alt="预览">
                </div>
                <div class="info-container">
                  <p id="fileInfo">未选择文件</p>
                </div>
                <div class="preview-actions">
                  <button id="changeImageBtn" class="btn btn-secondary">更换图像</button>
                </div>
              </div>
            </div>
          </div>
        </div>
      </section>
      
      <section class="section settings-section">
        <div class="card">
          <div class="card-header">
            <h2>图标设置</h2>
          </div>
          <div class="card-body">
            <div class="settings-group">
              <h3>选择平台</h3>
              <div class="platforms-container">
                <div class="platform-item selected">
                  <input type="checkbox" id="iosPlatform" value="iOS" checked>
                  <label for="iosPlatform">iOS</label>
                </div>
                <div class="platform-item selected">
                  <input type="checkbox" id="androidPlatform" value="Android" checked>
                  <label for="androidPlatform">Android</label>
                </div>
                <div class="platform-item">
                  <input type="checkbox" id="macosPlatform" value="macOS">
                  <label for="macosPlatform">macOS</label>
                </div>
                <div class="platform-item">
                  <input type="checkbox" id="windowsPlatform" value="Windows">
                  <label for="windowsPlatform">Windows</label>
                </div>
                <div class="platform-item">
                  <input type="checkbox" id="watchosPlatform" value="watchOS">
                  <label for="watchosPlatform">watchOS</label>
                </div>
              </div>
            </div>
            
            <div class="settings-group">
              <h3>输出选项</h3>
              <div class="options-container">
                <div class="option-item">
                  <input type="checkbox" id="createSubFolders" checked>
                  <label for="createSubFolders">为每个平台创建子文件夹</label>
                </div>
                <div class="option-item">
                  <input type="checkbox" id="prefixFilename">
                  <label for="prefixFilename">文件名添加平台前缀</label>
                </div>
                <div class="option-item">
                  <input type="checkbox" id="createContentsJson" checked>
                  <label for="createContentsJson">为iOS/macOS创建Contents.json文件</label>
                </div>
                <div class="option-item">
                  <input type="checkbox" id="createAdaptiveIcons" checked>
                  <label for="createAdaptiveIcons">为Android创建自适应图标相关文件</label>
                </div>
              </div>
            </div>
            
            <div class="button-container">
              <button id="generateBtn" class="btn btn-primary" disabled>生成图标</button>
              <button id="resetBtn" class="btn btn-secondary">重置</button>
            </div>
          </div>
        </div>
      </section>
      
      <section id="resultSection" class="section result-section" style="display: none;">
        <div class="card">
          <div class="card-header">
            <h2>生成结果</h2>
          </div>
          <div class="card-body">
            <div class="result-content" id="resultContent">
              <!-- 结果将在这里动态生成 -->
              <div id="resultPlaceholder" class="result-placeholder">
                <svg width="64" height="64" viewBox="0 0 24 24">
                  <path d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zm-5.04-6.71l-2.75 3.54-1.96-2.36L6.5 17h11l-3.54-4.71z"/>
                </svg>
                <p>生成图标后将在这里显示</p>
              </div>
            </div>
            
            <div class="download-section">
              <button id="downloadZipBtn" class="btn btn-success">下载所有图标</button>
            </div>
          </div>
        </div>
      </section>
    </main>
    
    <footer>
      <p>&copy; 2023 图标生成器 | 使用 HTML, CSS 和 JavaScript 构建</p>
    </footer>
    
    <!-- 通知组件 -->
    <div id="notification" class="notification">
      <div class="notification-content">
        <span id="notificationMessage"></span>
      </div>
    </div>
  </div>
  
  <!-- 加载脚本 -->
  <script src="js/iconSizes.js"></script>
  <script src="js/imageProcessor.js"></script>
  <script src="js/fileUtils.js"></script>
  <script src="js/main.js"></script>
</body>
</html> 